<template>
  <div class="app-container">
    这是自定义组件
    <br/>
    <h1>参数：</h1>
    {{params}}
    <br/>
    <h1>自定义按钮：</h1>
    <br/>
    <el-button type="primary" @click="submit">确 定</el-button>
    <el-button @click="handleCancel">取 消</el-button>
  </div>
</template>

<script>

export default {
  name: "Demo",
  props:{
    params:{
      type: Object,
      default:()=>{}
    }
  },
  data() {
    return {
    };
  },
  created() {
  },
  methods: {
    submit(){
      return new Promise((resolve, reject)=> {
        setTimeout(() => {
          this.msgSuccess('业务处理完成')
          resolve();
          // reject();
        }, 2000);
      });

    },
    /** 取消操作 **/
    handleCancel(){
      this.$emit("cancel")
    }
  }
};
</script>
